package com.example.druiddb.dao;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.Map;

/**
 * TODO
 *
 * @Author xiaojiang
 * @Date 2021/11/24 下午 12:03
 */
@Mapper
@Repository
public interface CommonMapper {

    @Select("show tables like #{tableName}")
    Map<String, String> checkTableExistsWithShow(@Param("tableName")String tableName);

    @Insert("CREATE TABLE `XDM_DATASOURCE_DOCUMENTS` (`COLLECTION` varchar(255) NOT NULL,  `DOCUMENT_NAME` varchar(255) NOT NULL,  `ETAG` varchar(255) NOT NULL,  `XML` longtext NOT NULL,  PRIMARY KEY (`COLLECTION`,`DOCUMENT_NAME`)) ENGINE=InnoDB DEFAULT CHARSET=utf8")
    int insertDocument();


}
